package com.bup.gn.model;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "lines")
@Access(AccessType.FIELD)
public class Line extends BaseEntity {
    @Column(name = "from_index")
    private int fromIndex;

    @Column(name = "to_index")
    private int toIndex;

    @Column(name = "content")
    private String content;

    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinColumn(name = "line_id", referencedColumnName = "id")
    private List<Like> likes;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getFromIndex() {
        return fromIndex;
    }

    public void setFromIndex(int fromIndex) {
        this.fromIndex = fromIndex;
    }

    public int getToIndex() {
        return toIndex;
    }

    public void setToIndex(int toIndex) {
        this.toIndex = toIndex;
    }

    public List<Like> getLikes() {
        return likes;
    }

    public void setLikes(List<Like> likes) {
        this.likes = likes;
    }
}
